package com.example.petshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.petshop.entity.Address;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Optional;

@Mapper
public interface AddressMapper extends BaseMapper<Address> {

    List<Address> getAddressesByUserId(Long userId);

    Address selectByAddressId(int addressid);

 

    void updateAddress(Address address);

    void insertAddress(Address address);
    int deleteById(int addressid);

    List<Address> findByUserId(Long userId);

    void saveAll(List<Address> addresses);

    Optional<Object> findById(int addressid);

    void save(Address defaultAddress);

    void updateAllAddressesToNonDefault(Long userId);

    void updateAddressToDefault(int addressid);


    Address getDefaultAddressByUserId(Long userId);
}
